Show AllShow All

About XML documents in Word

Note  XML features, except for saving documents as XML with the Word XML schema, are available only in Microsoft Office Professional Edition 2003 and stand-alone Microsoft Office Word 2003.

Why XML?

Extensible Markup Language (XML) enables you to organize and work with documents and data in ways that were previously impossible or very difficult. By using custom XML schemas, you can now identify and extract specific pieces of business data from ordinary business documents.

For example, an invoice that contains the name and address of a customer or a report that contains last quarter's financial results are no longer static documents. The information they contain can be passed to a database or reused elsewhere, outside of the documents.

The ability to save a Microsoft Word document in standard XML format helps separate its content from the confines of the document. The content becomes available for automated data-mining and repurposing processes. The content can easily be searched and even modified by processes other than Word, such as server-based data processing.

Because Word is capable of representing its documents as XML, automated server-based processes can now generate Word documents on the fly by pulling together data from various sources. Such a document could then easily be updated on a regular basis, eliminating the manual search for relevant data and unnecessary retyping.

Word and XML

Microsoft Word enables you to work with XML documents in two ways:

You can also store XML data in a document that you save as a Word document (.doc) or template (.dot). However, only Word will be able to read or process the XML.

XML tagging

When a custom XML schema is attached to a document, the XML Structure task pane provides a list of elements that are defined in the schema. You apply XML tags to the document by selecting document content and then choosing an element from the list. If the schema defines attributes for an element, you can specify these as well in the XML Structure task pane.

Note  You can attach more than one schema to a document. Elements from all attached schemas are available in the list of elements in the XML Structure task pane.

A check box on the pane enables you to see the XML tags inline, in the context of the document.

If the structure of the document violates the rules of the schema, a purple wavy line marks the spot in the document, and the XML Structure task pane reports the violation.

XSL Transformations

Upon opening and saving XML documents, you can apply Extensible Stylesheet Language Transformation (XSLT) files that render the XML data in a particular format. For example, you could have one XSLT that presents data as a specification and another XSLT that presents the same data as a parts list, where quantities and prices are calculated.

ShowXSLTs applied when opening a document

ShowXSLTs applied when saving a document